package com.slz3.business.module.configManagement.conFeedback.steward;

import com.slz3.business.frame.response.RR;
import com.slz3.business.frame.response.ResInfo;
import com.slz3.business.module.configManagement.conFeedback.domain.ConFeedback;
import com.slz3.business.module.configManagement.conFeedback.domain.ConFeedbackCondition;
import org.springframework.stereotype.Controller;
import org.springframework.web.reactive.function.server.ServerRequest;
import org.springframework.web.reactive.function.server.ServerResponse;
import reactor.core.publisher.Mono;

import javax.annotation.Resource;

public class ConFeedbackResController extends ConFeedbackResAtomic {

    public Mono<ServerResponse> add(ServerRequest req, ConFeedback conFeedback) {
        if (ConFeedbackResUnsafeValid.add(req, conFeedback)) {
            return RR.error(req, ResInfo.builder().theme(RR.UN_SAFE_VALID).description(RR.ILLEGAL_PARAM).build());
        } else {
            return super.add_$ConFeedbackUpdateLock(req, conFeedback);
        }
    }

    public Mono<ServerResponse> delete(ServerRequest req, ConFeedbackCondition conFeedbackCondition) {
        if (ConFeedbackResUnsafeValid.delete(req, conFeedbackCondition)) {
            return RR.error(req, ResInfo.builder().theme(RR.UN_SAFE_VALID).description(RR.ILLEGAL_PARAM).build());
        } else {
            return super.delete_$ConFeedbackUpdateLock(req, conFeedbackCondition);
        }
    }

    public Mono<ServerResponse> modify(ServerRequest req, ConFeedback conFeedback) {
        if (ConFeedbackResUnsafeValid.modify(req, conFeedback)) {
            return RR.error(req, ResInfo.builder().theme(RR.UN_SAFE_VALID).description(RR.ILLEGAL_PARAM).build());
        } else {
            return super.modify_$ConFeedbackUpdateLock(req, conFeedback);
        }
    }

    public Mono<ServerResponse> list(ServerRequest req) {
        if (ConFeedbackResUnsafeValid.list(req)) {
            return RR.error(req, ResInfo.builder().theme(RR.UN_SAFE_VALID).description(RR.ILLEGAL_PARAM).build());
        } else {
            return super.list(req);
        }
    }

    public Mono<ServerResponse> info(ServerRequest req) {
//        return conFeedbackResAtomic.info_$ConFeedbackUpdateLock(req);
        if (ConFeedbackResUnsafeValid.info(req)) {
            return RR.error(req, ResInfo.builder().theme(RR.UN_SAFE_VALID).description(RR.ILLEGAL_PARAM).build());
        } else {
            return super.info_$ConFeedbackUpdateLock(req);
        }
    }

    public Mono<ServerResponse> choice(ServerRequest req) {
        if (ConFeedbackResUnsafeValid.choice(req)) {
            return RR.error(req, ResInfo.builder().theme(RR.UN_SAFE_VALID).description(RR.ILLEGAL_PARAM).build());
        } else {
            return super.choice(req);
        }
    }

    public Mono<ServerResponse> auditSubmit(ServerRequest req, ConFeedbackCondition conFeedbackCondition) {
        //
        if (ConFeedbackResUnsafeValid.auditSubmit(req, conFeedbackCondition)) {
            return RR.error(req, ResInfo.builder().theme(RR.UN_SAFE_VALID).description(RR.ILLEGAL_PARAM).build());
        } else {
            return super.auditSubmit_$ConFeedbackUpdateLock(req, conFeedbackCondition);
        }
    }

    public Mono<ServerResponse> audit(ServerRequest req, ConFeedbackCondition conFeedbackCondition) {
        if (ConFeedbackResUnsafeValid.audit(req, conFeedbackCondition)) {
            return RR.error(req, ResInfo.builder().theme(RR.UN_SAFE_VALID).description(RR.ILLEGAL_PARAM).build());
        } else {
            return super.audit_$ConFeedbackUpdateLock(req, conFeedbackCondition);
        }
    }

    public Mono<ServerResponse> auditReject(ServerRequest req, ConFeedbackCondition conFeedbackCondition) {
        if (ConFeedbackResUnsafeValid.auditReject(req, conFeedbackCondition)) {
            return RR.error(req, ResInfo.builder().theme(RR.UN_SAFE_VALID).description(RR.ILLEGAL_PARAM).build());
        } else {
            return super.auditReject_$ConFeedbackUpdateLock(req, conFeedbackCondition);
        }
    }

    public Mono<ServerResponse> usingEnable(ServerRequest req, ConFeedbackCondition conFeedbackCondition) {
        if (ConFeedbackResUnsafeValid.usingEnable(req, conFeedbackCondition)) {
            return RR.error(req, ResInfo.builder().theme(RR.UN_SAFE_VALID).description(RR.ILLEGAL_PARAM).build());
        } else {
            return super.usingEnable_$ConFeedbackUpdateLock(req, conFeedbackCondition);
        }
    }

    public Mono<ServerResponse> usingDisable(ServerRequest req, ConFeedbackCondition conFeedbackCondition) {
        if (ConFeedbackResUnsafeValid.usingDisable(req, conFeedbackCondition)) {
            return RR.error(req, ResInfo.builder().theme(RR.UN_SAFE_VALID).description(RR.ILLEGAL_PARAM).build());
        } else {
            return super.usingDisable_$ConFeedbackUpdateLock(req, conFeedbackCondition);
        }
    }

}
